/**
 * Created by yihua on 2017/3/6.
 */

$(document).ready(function () {
    $(".delrankrecommend").each(function () {
        $(this).click(function () {
            var id = $(this).parent().parent().find("td").eq(0).text();
            $("#deleteModal").modal("show");
            $("#delete_confirm").unbind('click').click(function () {
                //$("#deleteModal").modal("hide");
                console.log(id)
                $.ajax({
                    url: '/home/management/delrecommenduser',
                    timeout: 100000,
                    type: 'get',
                    dataType: 'json',
                    data: {
                        'id': id,
                    },
                    success: function (rs) {
                        if (rs.errno != 0) {
                            toastr.error(rs.errmsg, '', {positionClass: 'toast-bottom-center'});
                        } else {
                            toastr.success(rs.errmsg);
                            $("#deleteModal").modal("hide");
                            window.location.reload();
                        }
                    },
                    error: function () {
                        toastr.error('系统错误', '', {positionClass: 'toast-bottom-center'});
                    }
                });
            });
        });
    });
});
/*

 * */